
export default function (timestamp) {
    var time = new Date(timestamp)
    var year = time.getFullYear(),
        month = time.getMonth() + 1 ,
        day = time.getDate(),
        hour = time.getHours(),
        minute = time.getMinutes(),
        second = time.getSeconds()
    return  year + '-' + add0(month) + '-' + add0(day) + ' ' + add0(hour) + ':' + add0(minute) + ':' + add0(second)  
}

function add0 (m) {
    return m < 10 ? '0' + m: m
}